*{margin: 0;padding: 0;}   /*消除各种浏览器的边距默认值*/
#nav {
    margin:20px auto;
    text-align:center;
}

#nav ul {
    border-radius:10px;
    background:linear-gradient(to bottom,#efefef,#bbbbbb);
    padding:0 20px;
    display:inline-table;
    position:relative;
    box-shadow:1px 1px 3px #666;
    list-style: none;
}

#nav ul ul {
    display:none;
}

#nav ul li {
    float:left;
    list-style: none;
}

#nav ul::after {
    content:"";
    display:block;
    clear:both;
}

#nav ul li a {
    display:block;
    padding:25px 40px;
    color:#000;
    text-decoration:none;
    font-family:"微软雅黑";
}

#nav ul li:hover > ul {
    display:block;
}

#nav ul li:hover {
    background:linear-gradient(to bottom,#4f5964,#5f6975);
}

#nav ul li:hover a {
    color:#FFF;
}

#nav ul ul {
    background:#5f6975;
    border-radius:0;
    position:absolute;
    top:auto;
    padding:0;
}

#nav ul ul li {
    float:none;
    border-top:1px solid #6b727c;
    border-bottom:1px solid #575f6a;
}

#nav ul ul li a {
    color:#FFF;
}

#nav ul ul li a:hover {
    background:#4b545f;
}

#nav ul ul ul {
    width:100%;
    position:absolute;
    left:100%;
    top:50%;
}